const gulp = require('gulp')
const less = require('gulp-less')
const prefixer = require('gulp-autoprefixer')
const min = require('gulp-minify-css')

gulp.task('default',()=>{
  gulp.src(['src/flex.less', 'src/data-flex.less'])
  .pipe(less())

  .pipe(prefixer({ //添加浏览器兼容的前缀
    browsers: [
      'ie >= 8',
      'ie_mob >= 10',
      'ff >= 26',
      'chrome >= 30',
      'safari >= 6',
      'opera >= 23',
      'ios >= 5',
      'android >= 2.3',
      'bb >= 10'
    ]
  }))

  //.pipe(min())
  .pipe(gulp.dest('dist'));
})

gulp.watch('src/*.less', ['default']);
